import java.awt.*;
import java.util.Arrays;
import java.util.Scanner;

public class Demo {
    public static boolean oddThree(int[] arr) {
        for (int i = 1; i < arr.length - 2; i++) {
            if(arr[i - 1] % 2 == 1 && arr[i] % 2 == 1 && arr[i + 1] % 2 == 1) {
                return true;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int[] arr = {1,3,2,4,5,72,9,2};
        System.out.println(oddThree(arr));
        int[] arr2 = {1,3,2,4,5,7,9,2};
        System.out.println(oddThree(arr2));
    }
    public static void main8(String[] args) {
        int[] arr = {1,1,1,2,3,3,4,4,1,1,1,3,1};
        int ret = arr[0];
        int count = 1;
        for (int i = 1; i < arr.length; i++) {
            if(ret == arr[i]) {
                count++;
            } else {
                if(count == 0) {
                    ret = arr[i];
                    count = 1;
                } else {
                    count--;
                }
            }
        }
        System.out.println(ret);
    }
    public static void main7(String[] args) {
        int[] arr = {66,11,22,3,4,88,4,3,22,66,88,6,9,9,6};
        int n = 0;
        for (int i = 0; i < arr.length; i++) {
            n ^= arr[i];
        }
        System.out.println(n);
    }
    public static void main6(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] arr = {4,12,3,4,7};
        int max = arr[0];
        int min = arr[0];
        int len = arr.length;
        for (int i = 1; i < len; i++) {
            if(max < arr[i]) {
                max = arr[i];
            }
            if(min > arr[i]) {
                min = arr[i];
            }
        }
        int target = in.nextInt();
        int[] isConform = new int[len];
        for (int i = 0; i < len; i++) {
            if(arr[i] + min <= target && arr[i] + max >= target) {
                isConform[i] = 1;
            }
        }
        int[] ret = {-1,-1};
        for (int i = 0; i < len; i++) {
            if(isConform[i] == 0) {
                continue;
            }
            for (int j = i; j < len; j++) {
                if(isConform[j] == 0) {
                    continue;
                }
                if(arr[i] + arr[j] == target) {
                    ret[0] = i;
                    ret[1] = j;
                }
            }
        }
        if(ret[0] == -1) {
            System.out.println("没有");
        } else {
            System.out.println(Arrays.toString(ret));;
        }
    }
    public static void main5(String[] args) {
        int[] arr = {8,7,6,5,4,3};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }
    private static void bubbleSort(int[] arr) {
        int len = arr.length;
        for (int i = 0; i < len - 1; i++) {
            for (int j = 0; j < len - 1 - i; j++) {
                if(arr[j] > arr[j + 1]) {
                    arr[j] = arr[j] ^ arr[j + 1];
                    arr[j + 1] = arr[j] ^ arr[j + 1];
                    arr[j] = arr[j] ^ arr[j + 1];
                }
            }
        }
    }

    public static int check(int[] arr, int n) {
        int r = arr.length - 1;
        int l = 0;
        while(l <= r) {
            int mid = r - (r - l) / 2;
            if(arr[mid] < n) {
                l = mid + 1;
            } else if (arr[mid] == n) {
                return mid;
            } else {
                r = mid - 1;
            }
        }
        return -1;
    }
    public static void main4(String[] args) {
        int[] arr = {1,3,5,7};
        for (int i = 0; i < arr.length; i++) {
            int index = check(arr, arr[i]);
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        System.out.println(check(arr, -1));
        System.out.println(check(arr, 4));
        System.out.println(check(arr, 9));
    }
    public static int indexOf(int[] arr, int type, int curLeftIndex, int curRightIndex) {
        type %= 2;//0 表示从左边开始找（找偶数）
        int[] yu = {0,1};//左边当余数位 0 时候停止（找到偶数）
        int[] bian = {1, -1};//左边 ++ 右边 --
        int[] typeIndex = {curLeftIndex, curRightIndex};
        while(typeIndex[0] < typeIndex[1]) {
            if(arr[typeIndex[type]] % 2 != yu[type]) {
                typeIndex[type] += bian[type];
            } else {
                return typeIndex[type];
            }
        }
        return -1;
    }
    public static void sort(int[] arr) {
        int r = arr.length - 1;
        int l = 0;
        while(l < r) {
            l = indexOf(arr, 0, l, r);
            if(l == -1) {
                return;
            }
            r = indexOf(arr, 1, l, r);
            if(r == -1) {
                break;
            }
            int t = arr[l];
            arr[l] = arr[r];
            arr[r] = t;
        }
    }
    public static void main3(String[] args) {
        int[] arr = {1,2,3,4,5,6,7};
        sort(arr);
        System.out.println(Arrays.toString(arr));
        int[] arr2 = {2};
        int[] arr3 = {3};
        int[] arr4 = {};
        sort(arr2);
        sort(arr3);
        sort(arr4);
        System.out.println(Arrays.toString(arr2));
        System.out.println(Arrays.toString(arr3));
        System.out.println(Arrays.toString(arr4));
    }
    public static void transform(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] *= 2;
        }
    }
    public static void main1(String[] args) {
        int[] arr = {1,2,3};
        System.out.println(Arrays.toString(arr));
        transform(arr);
        System.out.println(Arrays.toString(arr));
    }
}
